package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.FeaturedMapper;
import com.ruoyi.system.domain.Featured;
import com.ruoyi.system.service.IFeaturedService;

/**
 * 特色产品Service业务层处理
 *
 * @author ruoyi
 * @date 2023-09-08
 */
@Service
public class FeaturedServiceImpl implements IFeaturedService
{
    @Autowired
    private FeaturedMapper featuredMapper;

    /**
     * 查询特色产品
     *
     * @param id 特色产品主键
     * @return 特色产品
     */
    @Override
    public Featured selectFeaturedById(Long id)
    {
        return featuredMapper.selectFeaturedById(id);
    }

    /**
     * 查询特色产品列表
     *
     * @param featured 特色产品
     * @return 特色产品
     */
    @Override
    public List<Featured> selectFeaturedList(Featured featured)
    {
        return featuredMapper.selectFeaturedList(featured);
    }

    /**
     * 新增特色产品
     *
     * @param featured 特色产品
     * @return 结果
     */
    @Override
    public int insertFeatured(Featured featured)
    {
        featured.setCreateTime(DateUtils.getNowDate());
        return featuredMapper.insertFeatured(featured);
    }

    /**
     * 修改特色产品
     *
     * @param featured 特色产品
     * @return 结果
     */
    @Override
    public int updateFeatured(Featured featured)
    {
        featured.setUpdateTime(DateUtils.getNowDate());
        return featuredMapper.updateFeatured(featured);
    }

    /**
     * 批量删除特色产品
     *
     * @param ids 需要删除的特色产品主键
     * @return 结果
     */
    @Override
    public int deleteFeaturedByIds(Long[] ids)
    {
        return featuredMapper.deleteFeaturedByIds(ids);
    }

    /**
     * 删除特色产品信息
     *
     * @param id 特色产品主键
     * @return 结果
     */
    @Override
    public int deleteFeaturedById(Long id)
    {
        return featuredMapper.deleteFeaturedById(id);
    }
}
